Function for object traversal.