use of vector pair and comparision function in sort