Disable Checkout in a Sharepoint Document Library

To disable version history in all the document libraries for a site collection, here are the list of PowerShell commands to achieve the same.

  foreach ($list in $web.Lists)
 {

   if ($list.BaseType -eq "DocumentLibrary")
{

   Write-Host "List = " $list
     # Enable Versioning
     $list.EnableVersioning = $false
       $list.Update()
      }
 }