replaced py4j with java sockets