code for faster scanner