Added sum function