Reorder if statement