There was an overloaded version of `add_layer` that took a const reference to a source layer. The function would duplicate that layer. The function name `add_layer` was a bit confusing in this case. Calling it `duplicate_layer` makes it a bit clearer.