edit/update function and test complete