improve scanning algorithm