code for distributed systems