initial draft of download func complete