Added plotting to var_optimization