problem 3 implemented gives the right answer