adds config file, cleans up functions