Wrote eigenvalue kernel and helper functions