correcting syntax error and correcting conditional statements