Added sumSlice function.