Hi, 2023 Josh here. This code is really, really old. There's a lot of amateur mistakes here. Please don't judge too harshly.
You can find my (superior) reiteration of this idea here.