Tidy up the steepest descent code