first attempt at dirty-bit code
Merge branch 'master' again, because I fuced up the last one