uses external sum and fixes test