Added bpg_id method to TreeNode model