Cleaned up a lot of unnecessary code.

It works a lot faster now