added unit and integration tests