some reformatting and minor fixes