Added no of rules parameter