implement addModel function