Moved functions to Scripts/Functions.R