functioning version model py