updated MainMemory and added Unit Test, passed