added better edit functionality