improved syntax of if statement