print statements and bugs removed