My version of functions for traversal..Ashima