added code to use gam function to fit data in distance traveled