major edits and fixes