problem 4 was a lot easier than problem 3