modified plot-making script