more work on sorting