First rough implementation of scanner mode