the selectCell function will now terminate after the counter variable has reached 9.