add downloading function and config file