Sort until pivot reached