We use the control function approach to identify the average treatment efiect and the efiect of treatment on the treated in models with a continuous endogenous regressor whose impact is heterogeneous. We assume a stochastic polynomial restriction on the form of the heterogeneity but, unlike alternative nonparametric control function approaches, our approach does not require large support assumptions. We thank two anonymous,referees and Whitney Newey for their comments. We also thank participants