Fixed inconsistent tabbing, and optimized all code

You were using tabs in some places and spaces elsewhere, so I changed it to be all spaces. Also, you should consider using unix line-endings instead of winblows ones.

Also, optimized all code.