replace download script with enhanced version by Conrad