renamed & improved ai.