Added cumulative() function for cumulative plotting.