It is necessary to implement a function that can be used to simplify the chain by removing repetitive structurally identical nodes.
Example: