Wrote 4 functions for using 4 kinds of models