Iterative version, AC