functional improvements to example