added documentation; callbacks; address error bugfix (when not defined)