some code from my ventures through distributed systems