updating plotting code