working on preprocessing, propagate things from root to leaves