add AI

roughly edited AIBox using BFS. Still bit of bugs.