now handles empty rides although this has no unit tests