added unit tests and more parameterization