some fixes & add AI