Enhance sum function.