define fold left and sum and product to use it