Made plotting optional with a plot variable