Replaced py4j with sockets & threads