implements pow() method.