Added target flag within TreeNode
Initial traverse logic