changed the inner loops to go through sales and changed the product
query