Implement resursive `sum` function