add comments to explain the file traversing