Fixed sorting, completed part 8