an implementation of a sorted vector