added sum functionality