Added cumsum method.