removed dead code and fixed CS