which change do-while to while? it doesn't seem to make a difference and it causes the code to go out of sync with the traversal code in digest