added documentation, fixed tests