minor edits and comments for clarity