Refactor sum function and Add benchmark tests