sorted a vector instead