Format if statement correctly