added transmit function