Better algorithm for fenopy fallback