Added more tests, improved documentation