Step 2 : First sort