working on downloading function s