map extract + fixed memory stuff (i think)