fix #302 - Maybe change the sorting algorithm.