working scanner example