cleanup headers
cleanup example file
use const ref where possible
fix typo