A theory of scanning