add sort and binary search