Tidied up the tests and added example of use.
Added sort ordering