Updated plot function and analysis