added support for both types of packets (S and T)  and moved printfs into debug mode which may not have been all our problems but could have slowed things down. Need to test this.