fixed example
some bugfixes