Sort properly