reduce => functools.reduce