Added the code for the scanner class