Update function.R