edit function

Fully working edit window