I haven't looked at any version of this code and am having serious trouble figuring out what get_chunk_tx is for. It looks to me like it's doing the same thing that the previous loop did, but I assume that's not the case.
Help?