incorrectly swapped inner loop and last step cases in generalizedMatrixVectorProduct  example