updated code to build out the download script