Replaced full diagonalization by dsyev