implemented deletion of elements