Added all the global linear model code