calculating power is done