need stopping condition and AI