updated png and pdf plot functions yet again