inputregion must return the region
removing a goto in favor of a loop, too