Help with recursing through a library and it's sub-folders

Hello everyone.  I have a script that'll extract files & metadata (metadata into CSV) to a drive.  This script was designed for organizations when they have "audits" and things of that nature that you can't give the auditors the ability to access your SharePoint.  

So here's where my dilemma lies.  My script will copy all files to a designated location ONLY if the files are all at the root of the doc library.  How can I tweak this to copy the folders out as well?

NOTE:  I left off the functions for Option1 & Option2 (just to save space on here)


Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue

#Where to Download the files to. Sub-folders will be created for the documents and lists, respectively.
$destination = "G:\Extract\Doclib"
function DownloadAll($sourceweb, $metadatadestination, $listTitle, $folder)

$web = Get-SPWeb -Identity $siteUrl

      #Create a folder using the site's name
      $siteFolder = $destination + "\" +$web.Title+"Documents"
      $createSiteFolder = New-Item $siteFolder -type directory 
      $destination = $siteFolder

      $myList = $web.Lists[$listTitle]

      if($myList -ne $null)
            if($myList.Title -eq $listTitle)
                if($myList.BaseType -eq "DocumentLibrary")
                  Write-Host "Downloading Document Library: " $myList.Title
                  #Download root files
                  DownloadDocLib $myList.RootFolder.Url
                  #Download files in folders
                  foreach ($folder in $list.Folders) 
                    DownloadDocLib $folder.Url
      else{write-host -foreground "Red" $listname "list does not exist."}

      Write-Host "Creating Lists and Metadata"
      $sourceSPweb = Get-SPWeb -Identity $sourceweb
      $metadataFolder = $destination+"\"+$sourceSPweb.Title+" Lists and Metadata"
      $createMetaDataFolder = New-Item $metadataFolder -type directory 
      $metadatadestination = $metadataFolder

      $myList = $sourceSPweb.Lists[$listTitle]
      if($myList -ne $null)
            Write-Host "Exporting List MetaData: " $myList.Title
            $ListItems = $myList.Items 
            $Listlocation = $metadatadestination+"\"+$myList.Title+".csv"
            $ListItems | Select * | Export-Csv $Listlocation  -Force
      else{write-host -foreground "Red" $listname "list does not exist."}

#Prompt for Info
$selection = Read-Host "Press 1 for List Contents or 2 for List Metadata or 3 for both:"
$siteURL = Read-Host "Please enter the Site URL that hosts the list you want to extract:"
$listName = Read-Host "Please enter the Name of the List:"
if($selection -eq 1)
{DownloadSite $siteURL $listName}
elseif($selection -eq 2)
{DownloadMetadata $siteURL $destination $listName}
elseif($selection -eq 3)
{Downloadall $siteURL $destination $listName}