fixes the ArrayOutOfBounds error in the case where all but one square were taken. small changes in the AI logic.