Adding in if statement, and cleaning up indentation.