Tweaked recursive wget function