minor changes to fit math and memory additions