remove the avg_data from being passed by PHP and instead build it on the fly. This reduces the data transferred by almost half