fixed whitespace and added a comment to explain if statement