Refatorando RepeatedSquaring