added sanity check of optimization results