sort and test