Rebuilt AI, still needs fixes