public void Add(Node node) { Node temp = new Node(node.GetK(), node.GetCopiedDict()); if (nodes.Any(x => CompareSets(node, x))) { Node found = nodes.First(x => CompareSets(node, x)); found.SetK(found.GetK() + node.GetK()); } else { nodes.Insert(nodes.TakeWhile(x => ComparePowers(x, node) >= 0).Count(), temp); } nodes = nodes.Where(x => x.GetK() != 0).ToList(); }