Added most of the Edit functionality