Why is this call here and then again in the while loop below?