re arrange the if statements so that the more common appear first