Changed line-algorithms for using model.