Added the download functionality