improve documentation and example