change memory to two list, but still has bugs