some work in memoryStage.c