Writing Your Own Distributed Algorithms