Add comments
Cleanup
Finish refactoring, code greatly simplified