Worked on problem 3