Solve Problem 10, takes a lot of time...