Original sentence: A message was typed into a machine, which encoded and sent it to another unit.American cryptographers were able to build a machine that could decode these messages.However, the PURPLE codes were only used by the Foreign Office to carry diplomatic traffic to its embassies.The Japanese used a cipher machine to encode their diplomatic messages
Edited sentence: A message was typed into a  machine, which encoded and sent it to another unit.However, American cryptographers were able to build a machine that could decode these messages.The Japanese used a cipher machine to encode their cable traffic.Unfortunately, the PURPLE codes were only used by the Foreign Office to carry diplomatic traffic to its embassies