implemented basic insertion and deletion functions