added command and edit mode with cursor movement