model functions