added documentation and helper stuff