Formatting changes

Changed tabs to spaces, and did some minor formatting changes to make
the code more readable.