Modified Scanner to become a local object.