It would be great to have a docstring on this so I don't have to reverse-engineer it to understand it.