Formatting changes

I tried to make the code a bit more readable without changing too much.