remove unused variables and assignments