Added erase method and tests for it