updated product to not use flatMap