Adds a flatten array method