calculating eigenvalues and eigenvectors