small speed up in sumfunct

removed longest step from sumfunct. For loop is still slow and nasty