second parameter of groupByNode() is 0 indexed