fixed bug in read/write calc and finished MemAccess state