fix #194
code tweaks
Merge pull request #209 from apneadiving/master

fix + code tweaks