implemented first version of new lookup table which uses pointers to avoid checking cells twice. not running correct yet.