Made calculate_power work