Sorting Without Using Third Variable Issue