deps tree flattening alg