Uploading solution to Problem 7