functions to add/delete elements and modify order