Remove prod(); convert sum() to functor