implementation of 'scan' functionality continued.