fixed an error in memory.cpp and updated the last of the opperations. Code should be good for testing