flattening directory hierarchy