Made some of the lookups into real functions