Average power consumption code added