simpler standalone example. not api compatible
more work