problem 7 (so sloooooow)