 		storage[toStorageAddress] = memory[memoryAddress];
 		memory[memoryAddress] = storage[storageAddress];
 	}
-	pageTable[leastEntry] = makePTE(CURRENTTIME, pageNumber, VALID);
+	pageTable[leastEntry] = makePTE(threadIdx.x, CURRENTTIME, pageNumber, VALID);
 	return leastEntry * PAGE_SIZE + pageOffset;
 }
 

	u32 leastEntry = DNE;
	u32 leastTime  = DNE;
	for (u32 i = 0; i < PAGE_ENTRIES; i++) {
		if (leastTime > getLastUsedTime(pageTable[i])) {
			leastTime = getLastUsedTime(pageTable[i]);
			leastEntry = i;
		}

const uint32_t INVALID			= 0;
const uint32_t PAGENUMBERMASK	= 0x00003FFE;
const uint32_t LASTTIMEMASK		= 0xFFFFC000;
const uint32_t PIDMASK			= 0xC0000000;
const uint32_t DNE				= 0xFFFFFFFF;

// Lock & Unlock
