replace `minimum` with a function that can handle childless internal nodes