Added GAM fitting