Code added to dynamically create regions