Added some lines for Generate method...