Correct run-time complexity