moved sum functionality to a subscript