refrences to  ref changed to model
refrence to ref in  save connections function changed to model
ref now called model as it is more discriptive