Amended Plot 2 code