Working build. AI function still wip.