detecting rules