Changed file name to spat_functions.R