Cleaned, formatted and fixed

Cleaned the code, formatting included.
Fixed a few errors (some that would have spammed the console)
Made the code more efficient.
Merge pull request #1 from KingFaris10/master

Cleaned, formatted and fixed