Switched if statement to match