Added const to strings. Changed "transmit" to "write"/