Simplified code.  Now include a regularization term to pull trajectory
toward best seen trajectory so far.