Implementing scanner A.