We study nested sums, which can be viewed as building blocks for multi-scale multi-loop integrals. We show that these nested sums satisfy a Hopf algebra. The algebraic properties are used to derive an algorithm for the expansion of functions, where the expansion parameter $\eps$ occurs in the Pochhammer symbols. As an application of our techniques we present the result for the two-loop C-topology with one leg offshell and arbitrary powers of the propagators and arbitrary dimensions, which is useful for the NNLO calculation e+ e- -> 3 jets.