[issue #7] code updates from Richard Hudson

Signed-off-by: Carlos Montemuiño <carlos.montemuino@gmail.com>
Merge pull request #8 from cmontemuino/issue-7

[issue #7] code updates from Richard Hudson