Fixed #46 - sort now works properly