added region support to the main.c