this is the rpy combining script with initial loop to read both files in at once