getModel function

Output the full model