added code for optimality criterion plot