using a single Scanner object for all input instead of many local ones