final commit for task 4 - working at least for smallest and larges eigenvalue