Updated model functions

Updated model functions to work with new library models. Not sure if
they work yet.