many things; scan_ global variables to struct