edit_code function

Edit code based on user's input