Recreating ugly versions of the itertools functions because why not