Replaced simpson-sum with general sum defined in example