got editing to work nicely i think. code needs to be dried