change order of vars passed to plot function