plotted first part of problem 5