Fixed logic errors, added print statements to track replacement policy process