improved memory.c testing