code is in play to create the region minimization