Some AI Logic stuff.