Updated packetTransmitter pseudocode