more work on sorting. add sorting tests
work on sorting results