Updating plotting code