Worked on Problem 4