implement erase, and add unit tests for insert and erase