renamed send/recv functions, working implementation