making the sort work