added unit tests for this