Code for regression