replaced py4j with sockets