Second stab at this.
Merge pull request #19 from sole/issue-13-attempt2

Second stab at this