Here is my cleaned up solution.
For some reason, the runtimes fluctuate wildly, but it usually finished in 2 through 4 seconds.