minor code cleaning
Sort of working
fix for issue #2 with suggestions from @nmanzi