unique region ids

make sure region ids are unique
store regions in a hash table to make finding them faster