Rewrote the download code.