rewrite the insertion with binary search.