Added sort function to the vector.