fixes #13
fixes #12
unit test for #13
Merge pull request #14 from ruanjonker/rjdev

Rjdev