fully tested and documented version