added Kendricks local regression function
small chnages