Added comments to the scanner class]
Added comments and made minor changes to scanner