clean up code (remove some print functions and some useless instructions)