dont use res as a lookup map anymore