added snippet of erasing elements from an vector