reimplement sum/product using foldRight.