fix sort order, remove debugging