Implement vector sorting.