edit function added

added the edit fuction to repopulate the form.