Right now this is kinda long and pointless, some annotations will be added later to explain what I'm actually doing. This is sped up by about 4000%.