IDK if it's my reading disability or what, but I think it should say "duplicate and flatten" and not "flatten and duplicate" to make it easier / more understandable.
Maybe I'm just that kind of guy that needs to have the word in correct order, but whatever..
Regards,
Aleksander