added option to stop chains after N links
 Please enter the commit message for your changes. Lines starting