added unit tests and changed document