add powers by squaring example