cleaned up code, laid groundwork for itinerary generation