a bit reformatting to make it more readable

will look more closely to see if the code can be made better.