Implemented 'sum' function and unit test.