I had tried to tidy up some of the code structures, but it only slowed
the program down... a lot. So I guess this is it for now.