Completely rewriting my code to make it more modular and debuggable. Pushing to master previous status because the code currently in master is just way too old