add example and improve documentation