gets the edit functionality working