added rules for X and Y