exponentiation function
reorganization
added getline iwth external variables