written code for command edit