Converted the model to C