working scanner implemented