edit mode - added missing fields and headings

added some missing fields and headings,
made a new structure for the code and added some comments