added mem_chain.pl