bugfixes, updated example