correcting the use of itertools.islice