this looks ugly. I will look to itertools how to make it look better