how to insert, and, replace and delete elements in array (CRUD)