Ooops, fixed scanning routine