- fixed up compilation
- added comments