Formats a hash of arrays