Improve the implementation to replace recursive column iteration with looping to make the program 20% faster.