changed casting in LookupTables to be less confusing