Made sel not global anymore.