Finished function to load config file