add sum helper

ref #25, #121