Updated Plotting code