Lonely Planet Code Exercise