Modified the power function