Removed some commented out code and condensed an if statement