implemented modgen script