Changed sums to products