Try nested loops and walk through the dimensions by 2 vs by 1