Now allows edits. Code is not yet elegant.