changed Scanner class to be a singleton