fix seg masking; everything in place now