Finished the assignment.  Created a helper function in 2 and 3 to make the coding of plot4 simpler.