Remove all scanner.nextLine() calls and make scanner object-wise.

So using multiple commands in one line is accepted.