implement inverse optimization (in progress)