make_chain() function added