moved AI code around, one step works
merge