Add sum function.