hw2 sort fix