reordered __pow__ if statement