Test sum function