minor changes in Scanner logic