Update tdm.c

Mass copy of updates to include ACK functionality in this file.