finished Problem 5