removed unnecessary code and print statements