```\nfunction \_generateGroup(bytes32 schainId, uint numberOfNodes) private returns (uint[] memory nodesInGroup) {\n    Nodes nodes = Nodes(contractManager.getContract("Nodes"));\n    uint8 space = schains[schainId].partOfNode;\n    nodesInGroup = new uint[](numberOfNodes);\n\n    uint[] memory possibleNodes = isEnoughNodes(schainId);\n    require(possibleNodes.length >= nodesInGroup.length, "Not enough nodes to create Schain");\n    uint ignoringTail = 0;\n    uint random = uint(keccak256(abi.encodePacked(uint(blockhash(block.number.sub(1))), schainId)));\n    for (uint i = 0; i < nodesInGroup.length; ++i) {\n        uint index = random % (possibleNodes.length.sub(ignoringTail));\n        uint node = possibleNodes[index];\n        nodesInGroup[i] = node;\n        \_swap(possibleNodes, index, possibleNodes.length.sub(ignoringTail).sub(1));\n        ++ignoringTail;\n\n        \_exceptionsForGroups[schainId][node] = true;\n        addSchainForNode(node, schainId);\n        require(nodes.removeSpaceFromNode(node, space), "Could not remove space from Node");\n    }\n```\n