A method for modifying only select off-diagonal items in a matrix