reorder loops in D2_[23] - >10% speedup