added code for Figure C7