updated csv and ri to support better merging