Compact clipping mask code a little