Added some plotting and data recording features