update docs and code to match, and example to work