reformatted code for easier readability

Keep in mind though that I use tabs instead of spaces, so the actual indentation relies on your configuration (how many spaces used per tab, if using fixed width fonts etc).