adding rules generation and pdf