Added brackets to if statements