used dev.copy rather than png()