Rewritten ALOT

Rewritten alot of the code. 50% done.