outline of chains.py