Cleaned up the code and added some comments
Merge pull request #28 from g3-ks/madhatter--

Cleaned up the code and added some comments