Added functions for sending and recieving data