numscans is not a global variable anymore