move the lookup tables outside of the function that invokes them to speed things up