implement primative expm function