minor code changes, reformatting