Added send and receivefrom to header and optimised switch between RX/TX