Initial commit
Refactor, especially changing some for loops to while loops and removing string.h, to gain some speed improvements