added some comment formatting stuff and more code cleanup