Work better, but still wrong.
So much refactoring.
So much refactoring 2.
Merge pull request #8 from resd/master

Merge