Cleaning up to make it JSLint compatible. Still barking about 3 errors that can be disregarded