problem 34, still thinking about a fast solution.