while(h&gt;1||is_swapped){