Addressed comments and added unit test