An extended version of what I submitted for Lonely Planet's coding exercise