- Added find_optimal function