added flatten
changed description
changed flatten to array_flatten to follow standard naming scheme