making cumsum work