Created functions.R