Fixed the vector issue. The program runs, but there is some sort of problem with the erase function. Should save the indices of the particles we are supposed to remove to a list and delete them at the end of each time iteration, that may fix it.