my %ns_records = map {( shift @$_, [ @$_ ] )} @$data_by_rows;