forked from: Freaky Vector Sorting

