routine edit and create