Make O(n^2) insert in the naive algorithm