small efficiency improvement in topdown
robust to missing values