added comments and removed log statements