created sort for datas and compare mechanism