fully tested now and updated documentation