Fixed memory leak and converted demand statistics to percentage on output