A method and apparatus for transmitting data