sorted the vector