fix regression in treeSum and move secureSum to seperate file