chain.py some functions renamed