Reverted to old sort function, removed test.