refactored ai turn a little