lookup complexity fix + pyversion portability