fixes issue #204
Merge pull request #205 from bm371613/master

fixes issue #204

Already merge current implementation as it is clean enough and make sense. Additional clean up would be nice, but not required.