added a simple trip sorter and tests