reformatting and minor fixes