moved scanning logic to sentence