fixed first round of changes (mostly style) thanks to joe and josh