beginnings of scanning routines