changed context matrices to diagonal