added variables to mem.c