Re-fixed scanner

Accidentally reverted to previous version