updated memory array to be named mem