Changed from static to instance in Memory class