added download functionality, download doesn't work yet