added functions for calculating eigen values