Implement list `sum` function