mostly fixed, squash this and reindent