Code changes to calculate cpu %