code for first two plots