rough version of download script