added truncate method to vector, and further implemented flocking