added comments and removed 2 unnecessary lines of code