edits and added diagram