fixed CS and removed dead code