add model plotting function