Sequential intersect finished. R script fixes and refactoring