implemented solution to example2 in problem 3