new version of sort