Implement solution for plots 1-4.