itertools
rearrange so function and class definitions come before unittests