Enhance the AI.

The code is still a little bit mess, I hope you, guests, don`t mind.