refactored input code to EditModes