problem 3 was hard!