nicetraj: redo loops so we only need one context