implemented edit functionality.