First rewrite commit.
Adding everything else.
Merge pull request #1 from teasherm/rewrite

Rewrite