Added matrix exponentiation