added in code for downloading