added exponentiation
added GCD function
refactored a bit
refactored power a bit