clean up

various small edits and fixes to code