Implemented procedural solution with AI.