updated p5 with itertools.product