I think this loop can be factored out and used both here and in intialize