Fixed the if/then statements