Added some speedups to the download function