Some comments and reformatting in main