Adding AI to customizable grid size code