remove old commented-out code
Try Ceres numerical differentiation