added unit tests for required functions