the bitmask version

log to the file