Cleaned up code

There were some tabs in the code that I changed to spaces. Also formatted comments a bit more nicely and removed unnecessary whitespace.