fixes #45
update example for new api
reformat