more functions
more tests and documentation