Fixed a massive bug, I didn't allocate memory correctly, and outstepped the bounds of the buffers