updated original function. added function to make region file from list