a little rewrite of the interactive_jopa.py demo