reordering if