Renamed sort > sortByKey so it doesn't conflict with built in
Swig sort/ reverse