Part two is going to take 31 hours of computation, so I might need to improve that.
Also reformat the code, but that is nothing significant.