Base pow method. Slow implementation