genModel function to add generated models