This is a RoR solution to sort a trip