Working GAM achieved!

Seems to produce values for all the runs needed. Running this overnight.