clean up
(Note: res[1] is a scipy.optimize results instance)