moved scanning statement