small changes in plotting code