moved loading of scripts out of the functions file.