finished second graph code and plot