Revert "Fixed bug in gen script. Final Commit"

This reverts commit 803f782872d5af152c630c0ce7f256182e796b74.
final commit. all bug fixed