first, gen the root from source dataset