wrote code for plots 1-4 and output plots