The reason for the extra code to reduce the run time is that I have exactly the same problem you have. It will take too long to run at the moment.

Once I am happy that the solutions are correct I can remove the time saving code to save bytes and get a better golf score, but until then I need to leave it in.