realized dirty bit and a bunch of other changes needed