working on mpec -- gradient wrt value funciton not yet working