added example + bugfixes