If you're having trouble with the functions cumulative, try this...I think it could be right :S