doc: add an example
minor clean up: rename an output variable