refactor, simplify, add SortedVectorSet class.