Added code for downloading