Making calcSumPerState ready for use in a webpage with the variable pJsonData