halfway to matrixizing the loop