Two more memories were added and some refactoring