fix model calculation