Sort data according to #208 discussion