added comments and removed print statements