Added edit funciton and view.