implement downlaod function. Download files into current local directory