not O(n) but O(nlog(n))