final code changes for pt2 demo