fixed 'find_minima' problem