add sort and compare