Finished version D of the AI