implement concat function to concat an array with a flatten array supplied