implemented calculation of power balance