Memory class and filewriter class updated