wrote function extract_db() to download local database copy