New here, just did a little QoL adjustment to the code. Added in documentation and shifted lines for readability. Should be a little easier to discern what is happening.
I was planning to work on this code but I just noticed the new Charity grinder that seems to be active. I'll see what I can do.