removed unused variables and print statements