fixed tests and added documentation