fixed a bug in the stiffness matrix