Updated processJSON to improve processing.