Global States implementation + Match with Mask Fixes