an exercise in iterating through nested hashes