Update rf_functions.R