Changed sorting style + function