sim: work towards table functions
sim: lookups working