Changed from Scanner io to BufferedReader io and tested to make sure it works.