make changes to plot function