finishing up transmit code