Modified memory.c, started resorting