Changed original flatten to be named deepFlatten, added normal flatten, improved some other snippets.