more relevant exception
added formula for eigenvals
used proper return syntax