untested functions for insert and delete