now takes into account the root, too