improve testing:
- added reference implementation for new examples
- example with deeper nesting
use basic traversal in case scope pointer is missing (but it never is)