generate rules grid