almost working except for edit