small speed up in sumfunct

removed defensive programming elses - small speed up as there is no need
to check conditions twice