Add the O(k) method