speed up in sumfunct

changed sumfunct to handle data as a matrix, address lines to change by
index rather than by name. Still speed to gain here