The first pass at trying to figure out what I was doing, it works but it uses ~34GB of ram
A bit of a clean up, functionally identical to lampps.py but it uses way less ram. It has progress output in the terminal and outputs two text files called lower2middle.txt and lower2upper.txt
Things can be optimized a lot and could do with a whole refactor but that may be a while...