using itertools + enumerate instead of range(len())