first sort method part 2