Implemented optimal grammar selection
Prepared script for data generation