Added a replot function