started writing the edit functions