done and added unit test.