improved IDFs and masks