changes.

Signed-off-by: Daniel Fagnan <dnfagnan@gmail.com>
merged. Added tests.

Signed-off-by: Daniel Fagnan <dnfagnan@gmail.com>