added comments and print statements