Solution without using globals.
Merge pull request #104 from dmuir/master

Solution without using globals.