Code for Plot 1 & 2