Ai stuff and renderer functions