added flatten array function