problem 34, this took forever