add rough design of phase3 (problem with writing an int to virtualmemory (little or big endian), and whether we should make sure the modifications to globle variables should be locked). Wait for test from Cupjin^_^