Over-engineered solution to Puzzlenode #1