Took out a level of indentation by simplifying an if statement