region_chaining.R first commit