Added code for plots 3 and 4. Still need to do some clean up