Adapt the documentation of sum to its implementation

closes #115