progress

-some cleanup
-handling of retransmit
-got rid of needless sleeping in record thread
-some latency handling