final plot macro updated