Refresh Continued
Last clean up of AI function before abandoning to try upgrading to nextbot.