Updated Plot 3 code