Some pretty printing and removing trailing spaces