added regions and cleaned up comments