Thanks! I will leave them in.
Now if we can just figure out why the $doc and $folder variables are showing up as the $doc and no $folder variable available.. So weird...