refactoring

removing variables from the global name space

Also, reworked how the priority table checks to speed up the number of
checks down