I don't like the `prevdata` variable name, since it not only contains previous data, but also the extra stuff. `alldata` seems more appropriate?