O(n^3) method