test for completion of the traversal
while(p != null)