Adding problem 10 - not as performant as I wanted as it takes around 5 seconds