code for oap demo