This is new logic (see docstring)