Adding some comments to clarify
Cleaning up, commenting, adding some tests