DOC: add documentation
RF+DOC: update documentation and simplify implementation
SML+DTST: fix scope
DOC+DTST: provide examples