refactored some lines, commented out unnecessary lines