added new function that uses a matrix
added new function
added new ExponentiationBySquaring