A bunch of untested code for storing recorded states--this will break the chart page