Got some script working with R