added more tests and documentation