implemented basic erase function