finish assignemnt2 for simulating virtual memory system