[issue #7] code updates from Richard Hudson

Signed-off-by: Carlos Montemuiño <carlos.montemuino@gmail.com>