Added auto generation script.
Updated auto generation logic.