Modified to pipe data through sockets