added missing docstring, and always returning a list of nodes