added unit tests and updated readme