fixes and comments to improve coding style
Merge pull request #1 from spein/master

fixes and comments to improve coding style