removing unused variables and comments