improvements to scan matcher