simplified retransmit, added tests