change number of loops for each Tx to unsigned int instead of int