add dirty bits
fix dirty bit tests