using Scanner instead of BufferedReader.