Added most of the code for step b1. Only need to do the timeout if acks
aren't received.